package test01;

public class demo15 {
    public static void main(String[] args) {
        int result=0;
        for(int i=1;i<=1000;i++){
            for(int j=1;j<i;j++){
                if(i%j==0){
                    result+=j;
                }
            }
            if(result==i){
                System.out.print(i+" ");
            }
            result=0;
        }
    }
}
